package com.ciei.dpagm.common.enums;

/**
 * 表单属性值类型枚举
 * @author wangyan
 * @date 2022/06/01
 */
public enum FormValueTypeEnum {

    /**
     * 字符串类型
     */
    STRING(1, "字符串"),

    /**
     * 数字型
     */
    NUMERIC(2, "数字型"),

    /**
     * 数组
     */
    ARRAY(3, "数组"),

    /**
     * 布尔型
     */
    BOOLEAN(4, "布尔");


    private Integer typeId;
    private String typeDescription;

    FormValueTypeEnum(Integer typeId, String typeDescription) {
        this.typeId = typeId;
        this.typeDescription = typeDescription;
    }

    public Integer getTypeId() {
        return typeId;
    }

    public String getTypeDescription() {
        return typeDescription;
    }

    public static FormValueTypeEnum getEnumByValue(int value) {
        for (FormValueTypeEnum formValueTypeEnum : values()) {
            if (formValueTypeEnum.typeId == value) {
                return formValueTypeEnum;
            }
        }
        return null;
    }

}
